//
//  LSZHotCollectionVC.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/8/24.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZHotCollectionVC.h"


@interface LSZHotCollectionVC ()<UICollectionViewDelegate,UICollectionViewDataSource>
@property(nonatomic,strong) NSArray * arrayName;
@end

@implementation LSZHotCollectionVC
static NSString * const reuseIdentifier = @"Cell";
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout{
    self = [super initWithFrame:frame collectionViewLayout:layout];
    if (self) {
        self.dataSource = self;
        self.delegate = self;
        self.backgroundColor = [UIColor whiteColor];
        [self registerClass:[LSZHotTopImagerViewCollCell class] forCellWithReuseIdentifier:@"LSZHotTopImagerViewCollCell"];
        self.backgroundColor = [UIColor whiteColor];
//        self.arrayName = @[@"",@"",@"",@"",@"",@""];
    }
    return self;
}
//-(void)setClassManager:(LSZDynamicClassificationManager *)classManager
//{
//    self.arrayName = classManager.mutNameArray;
//    [self reloadData];
//}
-(void)setArray:(NSArray *)array
{
    self.arrayName = array;
    [self reloadData];
}
#pragma mark <UICollectionViewDataSource>
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.arrayName.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    LSZHotTopImagerViewCollCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"LSZHotTopImagerViewCollCell" forIndexPath:indexPath];
    if (self.arrayName.count >indexPath.row) {
        LSZListTopicsMg * mg = nil;
        mg = self.arrayName[indexPath.row];
        cell.listTopicsMg = mg;
    }
    return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    if (_pushNewBlock != nil) {
        _pushNewBlock(indexPath.row);
    } 
}
@end
